@extends('layouts.default')  
@section('content')
<div class="box primary">
    <header>
        <div class="icons">
            <i class="fa fa-edit"></i>
        </div>
        <h5>{{Lang::get('reservation.create_reservation')}}</h5>
        <div class="toolbar">
            <nav style="padding: 8px;">
                <a href="javascript:;" class="btn btn-default btn-xs collapse-box">
                    <i class="fa fa-minus"></i>
                </a> 
                <a href="javascript:;" class="btn btn-default btn-xs full-box">
                    <i class="fa fa-expand"></i>
                </a> 
                <a href="javascript:;" class="btn btn-danger btn-xs close-box">
                    <i class="fa fa-times"></i>
                </a> 
            </nav>
        </div>
    </header>
    <div id="div-1" class="body">
        {{ Form::open(array('url' => 'reservation_store', 'class'=>'form-horizontal','id'=>'form-validate')) }}
        @foreach($car as $c) 
        <div style="float:right;">
            <span class="btn btn-warning btn-xs">{{Lang::get('messages.class').' '.$c->class_name}}</span>
            <span class="btn btn-warning btn-xs">{{Lang::get('messages.license').' '.$c->License}}</span>
            <span class="btn btn-warning btn-xs">{{Lang::get('messages.model').' '.$c->Model}}</span>
        </div><br/><br/>
        <div class="form-group">
            {{ Form::label('drfirstname', Lang::get('rentals.drfirstname').'*', 
                            array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drfirstname','', array(
                                'placeholder' =>Lang::get('rentals.drfirstname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>               
        </div> 
        <div class="form-group">
            {{ Form::label('drlastname', Lang::get('rentals.drlastname').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drlastname','', array(
                                'placeholder' =>Lang::get('rentals.drlastname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>  
        <div class="form-group">
            {{ Form::label('drhphone', Lang::get('rentals.drhphone'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drhphone','', array(
                                'placeholder' =>Lang::get('rentals.drhphone'),
                                'class' => 'form-control',
                                )) 
                }}
                <div class="checkbox">
                    <div class="checkbox">
                        <label>
                            <div class="checker">
                                {{ Form::checkbox('abroad', 'yes') }}
                            </div>Jashte Shqiperise
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('cardnr', Lang::get('rentals.cardnr'),
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('cardnr','', array(
                                'placeholder' =>Lang::get('rentals.cardnr'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div> 
        <div class="form-group">
            {{ Form::label('cardexp', Lang::get('rentals.cardexp'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Helpers\Helper::date('cardexp', Input::old('cardexp') , array(
                                'class' => 'form-control',
                            )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('prepaid', Lang::get('rentals.prepaid'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('prepaid','', array(
                                'placeholder' =>Lang::get('rentals.prepaid'),
                                'class' => 'form-control',
                                )) 
                }}
                <div class="checkbox">
                    <div class="checkbox">
                        <label>
                            <div class="checker">
                                {{ Form::checkbox('payed', 'yes') }}
                            </div>Paguar
                        </label>
                    </div>
                </div>
            </div>
        </div>      
        <div class="row form-group">
            {{ Form::label('result', Lang::get('rentals.result'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-1">
                {{Form::text ('nrdays',isset($nrdays) ? $nrdays: '', array(
                                'placeholder' =>Lang::get('rentals.nrdays'),
                                'class' => 'form-control',
                                'readonly'=>true))}}
            </div>
            <div class="col-lg-1">
                {{Form::text ('rate',isset($rate) ? $rate: '', array(
                                'placeholder' =>Lang::get('rentals.rate'),
                                'class' => 'form-control'))}}
            </div>
            <div class="col-lg-1">
                <a id="res-btn" class="btn btn-default" data-original-title="" title="">=</a>
            </div>
            <div class="col-lg-1">
                {{Form::text ('totalpaid',isset($result) ? $result: '', array(
                                'placeholder' =>Lang::get('rentals.totalpaid'),
                                'class' => 'form-control',
                                'id'=>'result-reservation'))}}
            </div>
            <div class="col-lg-1">
                {{ Form::select('curency',$currencies, Input::old('currencies'), array(
                                'class' => 'form-control',
                                'placeholder' => Lang::get('rentals.curency'))) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('agency', Lang::get('rentals.agency'), array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-2">
                {{ Form::select('agency', array(
                                '' => ''), Input::old('agency'), array(
                                'placeholder' =>Lang::get('rentals.agency'),
                                'class' => 'form-control')) 
                }}
            </div> 
            
        </div><br/><div id="validation-div"></div>
        {{ Form::hidden('vehicle', $vehicle, array('id' => 'invisible_vehicle')) }}
        {{ Form::hidden('startdate', $startdate, array('id' => 'invisible_startdate')) }}
        {{ Form::hidden('enddate', $enddate, array('id' => 'invisible_enddate')) }}
        {{ Form::hidden('rentdays', $nrdays, array('id' => 'invisible_rentdays')) }}
        {{ Form::hidden('totalpaid', $result, array('id' => 'invisible_amount')) }}
        @endforeach
        {{ Form::submit(Lang::get('messages.reserve_btn'), array('class' => 'btn btn-success btn-line')) }}          
        <input type="button" value="{{ Lang::get('messages.cancel_btn')}}" class="btn btn-danger btn-line" 
               onClick="history.go(-1);
                       return true;">
        {{ Form::close() }}
    </div>
</div>

@stop

